/**
 * Created by xie on 2018/4/12.
 */
angular.module('service.auther', [
    'ngResource',
    'ngCookies'
])

    .service('AutherService', ['$http', '$resource', '$cookies',
        function ($http, $resource, $cookies) {

            this.checkUser = function (userid, pwd, success, error) {
                var resource = $resource(plantUrl + "user/checkid");
                return resource.get({userid: userid, pwd: pwd}, success, error)
            }
            this.addUser = function (info, success, error) {
                var resource = $resource(plantUrl + "user/addinfo");
                return resource.save({}, info, success, error)
            }

            this.updateUser = function (info, success, error) {
                var resource = $resource(plantUrl + "user/updateinfo");
                return resource.save({}, info, success, error)
            }

            this.sentMessage=function(userid,success, error) {
                var resource = $resource(plantUrl + "user/sendmsg");
                return resource.get({tel: userid}, success, error)
            }

            this.updatePwd = function (info, success, error) {
                var resource = $resource(plantUrl + "user/updatepwd");
                return resource.save({}, info, success, error)
            }
        }

    ])